<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>课程详情</title>
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
    <meta http-equiv="keywords" name="keywords" content="" />
    <meta http-equiv="description" name="description" content="" />
    <link href="css/ydui.css" rel="stylesheet" />
    <link href="https://cdn.bootcss.com/Swiper/4.2.0/css/swiper.min.css" rel="stylesheet">
    <script src="js/ydui.flexible.js"></script>
	<link rel="stylesheet" type="text/css" href="css/all.css?v=201850002"/>
</head>
	<body>
		<div class="g-flexview"  id="app" v-cloak>
			<div class="g-scrollview">
				<div class="index-content">
					<img src="img/admin.jpg" style=""/>
					<p class="name">{{name}}</p>
					<p class="type">沙盘学生</p>
				</div>	
				<div class="m-cell">
		            <a class="cell-item">
		                <div class="cell-left">课程名称</div>
		                <div class="cell-right">{{content.name}}</div>
		            </a>	            
		            <a class="cell-item">
		                <div class="cell-left">上课人数</div>
		                <div class="cell-right">{{content.personCount}}</div>
		            </a>
		            <a class="cell-item">
		                <div class="cell-left">上课组数</div>
		                <div class="cell-right">{{content.teamCount}}</div>
		            </a>	
		            <a class="cell-item">
		                <div class="cell-left">创建人</div>
		                <div class="cell-right">{{content.realName}}</div>
		            </a>	
		            <a class="cell-item">
		                <div class="cell-left">创建时间</div>
		                <div class="cell-right">{{content.createTime}}</div>
		            </a>	
		            <a class="cell-item">
		                <div class="cell-left">开课时间</div>
		                <div class="cell-right">{{content.startTime}}</div>
		            </a>	
		            <a class="cell-item">
		                <div class="cell-left">课程简介</div>
		                <div class="cell-right"></div>
		            </a>
		            <div class="cell-item">
		                <div class="cell-right">
		                    <p	 class="cell-textarea" v-html="content.intro"></p>
		                </div>
		            </div>		            
		        </div>				
			</div>
			<button type="button" class="btn-block btn-primary" v-on:click="post" style="background: #00d0ba;" v-if="content.isJoin==0">点击报名</button>
			<button type="button" class="btn-block btn-danger" v-if="content.isJoin==1">已报名</button>
		</div>
	</body>
    <script src="https://cdn.bootcss.com/jquery/2.2.0/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/vue/2.5.15/vue.min.js"></script>
    <script src="js/ydui.js"></script>
	<script src="js/all.js" type="text/javascript" charset="utf-8"></script>
	<script>
		var model = new Vue({
			el:"#app",
			data:{
				name:ComFunJS.getCookie('realName'),				
				content:JSON.parse(localStorage.getItem('content')),
			},
			methods:{
				post:function(){		  					
					ComFunJS.postJSON(ComFunJS.APIURL('/course/student/join'),{"courseId":model.content.courseId,},function(r){
						if(!r.error){
							ComFunJS.showMsg('报名成功','success')					
	    					window.location.href='index.html'
						}else{
							ComFunJS.showMsg(r.message,'error')					
						}
						
					})
				}, 
	        	iniit:function(){
	        		this.$nextTick(function(){
	        		})
	        	}
			},
			created:function(){
			}
		})
	</script>
</html>
